package com.example.jopewars;

import java.util.ArrayList;
import java.util.List;

public class Location {

	private String name;

	private int policePresencePercentage;

	private int minDrugs;

	private int maxDrugs;

	private List<Drug> availableDrugs;

	private static List<Location> locations;

	public static List<Location> getLocations() {
		if (locations == null) {
			locations = new ArrayList<Location>();
		}
		return locations;
	}

	public static Location getLocation(String name) {
		Location l = null;
		for (Location loc : getLocations()) {
			if (loc.getName().equals(name)) {
				l = loc;
			}
		}

		return l;
	}

	public Location() {

	}

	public String getName() {
		return name;
	}

	public List<Drug> getDrugs() {
		return availableDrugs;
	}

	public void setDrugs(List<Drug> drugs) {
		this.availableDrugs = drugs;
	}

	public int getPolicePresencePercentage() {
		return policePresencePercentage;
	}

	public void setPolicePresencePercentage(int policePresencePercentage) {
		this.policePresencePercentage = policePresencePercentage;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setMaxDrugs(int max_drugs) {
		this.maxDrugs = max_drugs;
	}

	public void setMinDrugs(int minDrugs) {
		this.minDrugs = minDrugs;
	}

	public int getMinDrugs() {
		return minDrugs;
	}

	public int getMaxDrugs() {
		return maxDrugs;
	}

}
